//
//  MideaDataSecurity.h
//  midea
//
//  Created by xuenianxiang on 14-8-14.
//  Copyright (c) 2014年 keane. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface MideaDataSecurity : NSObject

//登陆密码加密(服务器)
+(NSString *)serverLoginPasswordEncryption:(NSString *)msg loginID:(NSString *)loginID;

//获取签名
+(NSString *)getSignWithApi:(NSString *)api andPostDic:(NSDictionary *)postDic;

//本地通信消息体加密
+(NSMutableArray *)localMessageBodyEncryption:(NSArray *)messageArray;

//本地通信消息体解密
+(NSMutableArray *)localMessageBodyDecryption:(NSData *)data;

//登陆后的敏感数据加密(美居、海外用户)
+(NSString *)sensitiveDataEncryption:(NSString *)accessToken msg:(NSString *)msg;

//登陆后的敏感数据解密(美居、海外用户)
+(NSString *)sensitiveDataDecryption:(NSString *)accessToken reply:(NSString *)reply;

//登陆后的敏感数据加密(第三方电商用户)
+(NSString *)sensitiveDataEncryptionForThird:(NSString *)msg;

//登陆后的敏感数据解密(第三方电商用户)
+(NSString *)sensitiveDataDecryptionForThird:(NSString *)reply;

//注册密码加密
+(NSString *)registerPasswordEncryption:(NSString *)msg;

//MD5_128加密
+(NSString *)getMD5_128:(NSString *)str;
+(NSString *)getMD5_128WithData:(NSData *)data;

//SHA256加密
+(NSString *)getSha256String:( NSString *)srcString;

//NSData 转换成 16进制小写字符串
+(NSString*)hexStringForData:(NSData*)data;

//16进制小写字符串 转换成 NSData
+(NSData*)dataForHexString:(NSString*)hexString;

//AES128加密、解密(utf8)
+(NSString *)AES128Encrypt:(NSString *)plainText key:(NSString *)key;
+(NSString *)AES128Decrypt:(NSString *)encryptText key:(NSString *)key;

//AES128加密、解密(hexStr)
+(NSData *)AES128EncryptWithData:(NSData *)data key:(NSString *)key;
+(NSData *)AES128DecryptWithData:(NSData *)data key:(NSString *)key;


@end
